#include "hpy.h"
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char* argv[])
{
    registerGen(argc, argv, 1);
    auto [n, t] = tuple{opt<int>(1), opt<int>(2)};
    auto e = genTree(n, t);
    int l = rnd.next(1, n), r = rnd.next(1, n);
    while(l == r) l = rnd.next(1, n), r = rnd.next(1, n);
    e.emplace_back(l, r);
    shuffle(e.begin(), e.end());
    println(n);
    for(auto &[u, v] : e)
        println(u, v);
}
